﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_WeiXinImg : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string imgUrl = Request.QueryString["imgUrl"];
        Uri myUri = new Uri(imgUrl);
        WebRequest webRequest = WebRequest.Create(myUri);
        WebResponse webResponse = webRequest.GetResponse();
        Bitmap myImage = new Bitmap(webResponse.GetResponseStream());
        MemoryStream ms = new MemoryStream();
        myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
        Response.ClearContent();
        Response.ContentType = "image/Jpeg";
        Response.BinaryWrite(ms.ToArray());
    }
}